package com.lagou;

import com.lagou.bean.Resume;
import com.lagou.repository.ResumeRepository;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class MongoRepositoryMain {
    public static void main(String[] args) {
        ApplicationContext  applicationContext = SpringApplication.run(MongoRepositoryMain.class,args);
        ResumeRepository  resumeRepository = applicationContext.getBean(ResumeRepository.class);

//        for (int i=0; i< 1000; i++) {
//            Resume resume  = new Resume();
//            resume.setName("zlgtest" + i);
//            resume.setExpectSalary(15000 + i);
//            resume.setCity("sh");
//            resumeRepository.save(resume);
//        }

//        Resume resume  = new Resume();
//        resume.setName("zlgtest3");
//        resume.setExpectSalary(18000);
//        resume.setCity("sh");
//        resumeRepository.save(resume);

        System.out.println(resumeRepository.findAll());
//        System.out.println(resumeRepository.findByNameEquals("zlgtest"));
//        System.out.println(resumeRepository.findByNameAndExpectSalary("zlgtest",15050));


    }
}
